﻿using FluentValidation;
using FikriKibar.Entities.Composite.BaseModels;
using FikriKibar.Entities.Concrete;
using FikriKibar.Globalization;

namespace FikriKibar.Common.Validation.FluentValidation.ContentType
{
    public class UpdateRules : AbstractValidator<UpdateModel<ContentTypeLanguageLine>>
    {
        public UpdateRules()
        {
            RuleFor(p => p.Item.ContentTypeName).NotEmpty().WithMessage(Resources.NameNotEmpty);
            RuleFor(p => p.Item.ContentTypeName).Length(2, 100).WithMessage(Resources.NameLength);
            RuleFor(p => p.Item.PublishBeginDate).NotEmpty().WithMessage(Resources.NameLength);
            RuleFor(p => p.Item.PublishEndDate).NotEmpty().WithMessage(Resources.NameLength);
        }
    }
}
